如何安装私有 GitLab 服务

Official WebSite

https://about.gitlab.com/downloads/

http://www.gitlab.cc/downloads/

On CentOS

  1. Download Newest rpm Package:

Go To TsingHua.edu.cn Mirror:

http://mirror.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/

Then Download The Latest Package

  1. rpm Install The Package

rpm -i gitlab-ce-XXX.rpm

  1. Reconfigure The config File
1
2
3
4
5
6
7
$ vim /etc/gitlab/gitlab.rb

external_url 'http://gitlab.yourdomain.com'

// Default Listening Port Is 127.0.0.1:8080
unicorn['listen'] = '127.0.0.1'
unicorn['port'] = 8080
  1. Use Nginx As Virtual Host Server (As You Like)
1
2
3
4
5
6
7
8
9
10
11
12
13
server {
listen 80;
server_name gitlab.yourdomain.com;
location / {
proxy_pass http://127.0.0.1:8080/;
proxy_redirect default;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
  1. Connect And Login:

Connect http://gitlab.yourdomain.com/

Login With Username: root And Password: 5iveL!fe

  1. Congratulations!

With Docker

1
2
3
4
5
6
7
8
9
sudo docker run --detach \
--hostname gitlab.yourdomain.com \
--publish 443:443 --publish 80:80 --publish 22:22 \
--name gitlab \
--restart always \
--volume `pwd`/gitlab/config:/etc/gitlab \
--volume `pwd`/gitlab/logs:/var/log/gitlab \
--volume `pwd`/gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ce:latest
Donate - Support to make this site better.
捐助 - 支持我让我做得更好.